package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class Teacher {
    @Pointcut("execution(* com.itheima.service.Student.*(..))")
    public void pt(){}

    @Around("pt()")
    public void around(ProceedingJoinPoint pjp){
        System.out.println("每日回顾。。。");

        try {
             pjp.proceed();
            System.out.println("每日总结。。。");
        } catch (Throwable throwable) {
            System.out.println("解答问题。。。");
        } finally {
            System.out.println("高薪就业。。。");
        }
    }
}
